
import axios from '@/libs/axios1';
let jsonHeaders = { 'content-type': 'application/json;charset=UTF-8' };
let baseUrl = '/scientific/category';

//查询
export const queryCategory = () => {
    return axios({
        url: `${baseUrl}/page`,
        method: 'GET',
        params: {},
        headers: jsonHeaders,
    });
};

//查询
export const queryAllCategory = () => {
    return axios({
        url: `${baseUrl}`,
        method: 'GET',
        params: {},
        headers: jsonHeaders,
    });
};

// 添加
export const addCategory = (data) => {
    return axios({
        url: `${baseUrl}`,
        method: 'POST',
        data,
        headers: jsonHeaders,
    });
};

// 修改
export const updateCategory = (id,data) => {
    return axios({
        url: `${baseUrl}/${id}`,
        method: 'PUT',
        data,
        headers: jsonHeaders,
    });
};

// 删除
export const delCategory = (id) => {
    return axios({
        url: `${baseUrl}/${id}`,
        method: 'DELETE',
        headers: jsonHeaders,
    });
};